<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
     <head>
     <link href="{{MEDIA_URL}}/img/favicon.ico" rel="icon" type="image/x-icon"> 
     <link href="{{MEDIA_URL}}mdm/css/smoothness/jquery-ui-1.8.5.custom.css" rel="stylesheet" type="text/css" media="screen"/>      
     <link href="{{MEDIA_URL}}mdm/css/mdm.css" rel="stylesheet" type="text/css" media="screen"/>      
     <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
     <script type="text/javascript" src="{{ MEDIA_URL }}mdm/js/jquery-ui-1.8.5.custom.min.js"></script>
     <title>Avanza Promociones</title>    
     </head>
<body>

     <a href="http://{{ request.get_host }}" title="Avanza Promociones. Inicio"><img src="{{ MEDIA_URL }}/img/logo.png"/></a>
     <div id="frm" title="Introduce tus datos">
          <form id="formulario" method="post" action="{% url django.contrib.auth.views.login %}">
          {% csrf_token %} 
          <table id="form">
          <tr>
              <td>{{ form.username.label_tag }}</td>
              <td>{{ form.username }}</td>
          </tr>
          <tr>
              <td>{{ form.password.label_tag }}</td>
              <td>{{ form.password }}</td>
          </tr>
          <tr>
               <td colspan="2">
                         {% if form.errors %}
                         <p class="error">El usuario y/o contrase&ntilde;a que ha introducido no coinciden con los que tenemos registrados. Por favor, int&eacute;ntelo de nuevo.</p>
                         {% endif %}
               </td>
          </tr>
          </table>
          <input type="hidden" name="next" value="{{ next }}" />
          </form>
     </div>

     <script>
          // El diálogo 
          $("#frm").dialog({
               bgiframe: true,
               autoOpen: true,
               height: 'auto',
               minHeight: 200,
               width: 400,
               position: ['center', 100],
               modal: false,
               resizable: false,
               draggable: false,
               closeOnEscape: false,
               open: function(event, ui) { $(".ui-dialog-titlebar-close").hide() },
               buttons: {
                    'Aceptar': function() {
                         $('#formulario').submit()
                    },
               }

          })
     </script>
     </body> 
</html>